mod user;

use serde::{Deserialize, Serialize};
pub use user::router as user_router;

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct Info<T> {
    code: Option<i64>,
    msg: Option<String>,
    data: Option<T>,
}

impl<T> Info<T> {
    fn data(code: i64, msg: &str, data: Option<T>) -> Self {
        Self {
            code: Some(code),
            msg: Some(msg.to_string()),
            data,
        }
    }
}